﻿# Copyright © 2014, Microsoft Corporation. All rights reserved.
function New-InitializationFile 
{
    [CmdletBinding()]
    [Alias()]
    [OutputType([int])]
    Param
    (
        [Parameter(Mandatory=$true,
                   Position=0)]
        $Path,

        [Parameter(Position=1)]
        $Toolkit
    )
Write-Verbose "New    [InitializationFile]$path"
''> $path
$toolkitNames = @()
foreach ($t in $toolkit)
{
    $toolkitNames += ("$t" +'-Toolkit')
}

@"
<#
This is a auto-generated JEA startup file
Generated At:     $(Get-date)
Generated On:     $(hostname)
Generated By:     $($env:UserDomain + '\' + $env:UserName)
#>
function whoami {`$PSSenderInfo}

`$Init = (Join-Path `$env:ProgramFiles 'Jea\Util\Initialize-Toolkit.ps1')
. `$Init -toolkit $($Toolkitnames -join ',')

"@ > $path
    
}
